<template>
  <div class="index">
      <div class="wrap">
        <div class="crumbs flex">
          <router-link to="/" class="p">首页</router-link>
          <router-link :to="link" class="p">>{{linkname}}</router-link>
          <div class="p">>{{title}}</div>
        </div>

        <div class="centent">
          <div class="centent-title">{{datas.title}}</div>
          <div class="centent-div" v-html="datas.content"></div>
          <!-- <div class="frien flex-jus">
            <div class="friena flex">上一个产品： <p>天虹服务中心</p></div>
            <div class="friena flex">下一个产品： <p>坪洲服务中心</p></div>
          </div> -->
        </div>
      </div>
  </div>
</template>
<script>
import {getInfomationDetail} from '@/api/service/service'
export default {
  name: "index",
  data() {
    return {
        parent:{},                      //获取父路由信息
        title:"",
        img:require("../../assets/image/profile.jpg"),
        id:"",                            //文章id
        datas:{},
        link:"",
        linkname:""
    }
  },
  created(){
    this.id=this.getQueryString("id");
    switch(this.getQueryString("p")){
      case '1':
        this.link = "/information";
        this.linkname = "台商区介绍";
        break;
      case '2':
        this.link = "/information/indexe";
        this.linkname = "新闻动态";
        break;
      case '3':
        this.link = "/information/indexa";
        this.linkname = "园区介绍";
        break;
      case '4':
        this.link = "/information/indexb";
        this.linkname = "通知公告";
        break;
      case '5':
        this.link = "/information/indexc";
        this.linkname = "创业";
        break;
      case '6':
        this.link = "/information/indexd";
        this.linkname = "求学";
        break;
      default:
    }
    // if(this.getQueryString("p") == 1){
    //   this.link = "/information";
    //   this.linkname = "台商区介绍";
    // }
    
    this.getInfomationDetailapi()
  },
  mounted(){
      this.parent = this.$route.matched[0];
      this.title = this.$route.meta.title;
  },
  methods:{
    togNav(e){
      this.$router.push(e)
    },
    getQueryString (name) { 
      let reg = `(^|&)${name}=([^&]*)(&|$)`
      let r = window.location.search.substr(1).match(reg); 
      if (r != null) return unescape(r[2]); return null; 
    },
    getInfomationDetailapi(){
      getInfomationDetail({id:this.id}).then(res=>{
        this.datas = res.datas
      })
    }
  }
}
</script>
<style scoped>
.index{
  background: #fff;
}
.crumbs{
    padding: 10px 0 0 0;
}
.crumbs .p{
    font-size: 14px;
}
.service-title{
  padding: 36px 0 0 0;
  text-align: center;
  color: #5E9F8E;
}
.service-title h2{
  font-size: 36px;
  line-height: 52px;
}
.service-title p{
  font-size: 14px;
  line-height: 24px;
  text-transform:uppercase;
}
.nav {
  padding: 0;
}
.nav li{
  font-size: 16px;
  color: #343434;
  line-height: 20px;
  padding: 0 15px;
  transition:all .5s;
}
.nav li.on{
  color: #CE3A5C;
}
.nav li:hover{
  color: #CE3A5C;
}
.top {
  padding-top: 90px;
}
.top .top-img{
  width: 438px;
  height: 410px;
}
.top .top-right{
  padding-top: 12px;
  padding-right: 20px;
  padding-left: 110px;
  width: 600px;
  box-sizing:unset
}
.top .top-right .top-right-title{
  font-size: 28px;
  line-height: 30px;
  padding-bottom: 2px;
  color: #121212;
  position: relative;
}
.top .top-right .top-right-title::after{
  content: " ";
  position: absolute;
  top: 0;
  left: -20px;
  width: 7px;
  height: 32px;
  border-radius: 4px;
  background: #3EACC4;
}
.top .top-right .p1{
  font-size: 18px;
  padding: 20px 0 10px 0;
  color: #343434;
}
.top .top-right .p2{
  padding-bottom: 20px;
  color: #343434;
  font-size: 14px;
  line-height: 30px;
}
.top .top-right .p3{
  line-height: 28px;
  font-size: 16px;
  position: relative;
  color: #3EACC4;
  padding-left: 30px;
}
.centent{
  padding: 50px 0;
  line-height: 180%;
}
.centent .centent-title{
  font-size: 28px;
  color: #343434;
  padding: 2px 0 20px 0;
  text-align: center;
}
.centent .frien{
  padding-top: 50px;

}
.centent .frien .friena{
  padding: 0 26px;
  color: #3EABC4;
  font-size: 12px;
  line-height: 120%;
}
.centent-div{
  line-height: 180%;
}

</style>